package com.ddwl.user.constant;

import com.ddwl.common.constant.SmsCaptchaNodeEnum;

/**
 * 类LoginTypeEnum.java的实现描述：登录类型
 *
 * @author zach
 * @Date :2020-08-27 20:10.
 */
public enum LoginTypeEnum {

    /**
     * 手机号短信登录
     */
    SMS("0"),
    /**
     * 短信验证码登录
     */
    WX("1"),
    /**
     * 密码登录
     */
    PASSWORD("2"),
    ;

    private String value;

    LoginTypeEnum(String value) {
        this.value = value;
    }

    public String getValue() {
        return this.value;
    }

    public static LoginTypeEnum getByValue(String value){
        for(LoginTypeEnum resultEnum: LoginTypeEnum.values()){
            if(resultEnum.getValue().equals(value)){
                return resultEnum;
            }
        }
        throw new IllegalArgumentException("枚举:" +SmsCaptchaNodeEnum.class.getSimpleName() + "不包含value:" + value);
    }
}
